package com.example.lottery.dao.mapper;

import com.example.lottery.dao.dataobject.ActivityPrizeDO;
import com.example.lottery.dao.dataobject.UserDO;
import com.example.lottery.dao.dataobject.WinningRecordDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WinningRecordMapper {
    int insert(WinningRecordDO row);

    int insertSelective(WinningRecordDO row);

    WinningRecordDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(WinningRecordDO row);

    int updateByPrimaryKey(WinningRecordDO row);

    void insertList(@Param("winningRecordDOS") List<WinningRecordDO> winningRecordDOS);

    List<ActivityPrizeDO> selectPrizes(@Param("activityId") Long activityId);

    List<UserDO> selectUsers(Long activityId);

    List<WinningRecordDO> selectByPrimaryKeys(@Param("activityId") Long activityId, @Param("prizeId")Long prizeId,
                                        @Param("winnerList")List<Long> winnerList);

    int deleteWinningRecordInfo(@Param("activityId") Long activityId, @Param("prizeId")Long prizeId);

    /**
     * 通过活动Id获取全量中奖记录
     * @param activityId
     * @return
     */
    List<WinningRecordDO>selectByActivityId(@Param("activityId")Long activityId);

    /**
     * 通过活动Id 奖品Id获取奖品维度的信息
     * @param prizeId
     * @param activityId
     * @return
     */
    List<WinningRecordDO> selectByPA(@Param("prizeId") Long prizeId, @Param("activityId") Long activityId);

    /**
     * 通过奖品Id获取中奖记录，或者活动Id获取中奖记录
     * @param activityId
     * @param prizeId
     * @return
     */
    List<WinningRecordDO> selectByActivityIdOrPrizeId(@Param("activityId") Long activityId,@Param("prizeId")Long prizeId);
}